﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.ComponentModel;

namespace System.Windows.Media.DirectShow
{
    public interface IAsyncReader
    {
        void Request(long startMediaTime, long endMediaTime, object state);

        event EventHandler<ReaderAsyncCompletedEventArgs> RequestCompleted;

        IMemAllocator RequestAllocator(IMemAllocator preferred, AllocatorProperties properties);
    }

    public class ReaderAsyncCompletedEventArgs : AsyncCompletedEventArgs
    {
        private IMediaSample _sample;

        internal ReaderAsyncCompletedEventArgs(IMediaSample sample, object userState) : base(null, false, userState)
        {
            _sample = sample;
        }

        public IMediaSample Sample
        {
            get { return _sample; }
        }
    }
}
